package com.coderyeah.cosmetology.util;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result {
    private String code;
    private String msg;
    private Object data;

    public static Result success(Object data) {
        return new Result(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMsg(), data);
    }

    public static Result fail() {
        return new Result(ResultCode.FAIL.getCode(), ResultCode.FAIL.getMsg(), null);
    }
}
